Page({
  data: {
    //轮播图
    swiperCurrent: 1,
    arr: [{
        images: 'http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0A6tex/ruAMsa53pVQWN7FLK88i5j0ugyufks8dD.dyFkMKbv3Sg3qSuvNzoWxHjTpfQN6*x4juS6Xrng0XgPLCpYBwp69Lj*6eKhSQBc3GCDCQMvA!/b&bo=gAJFBasCoAUBCeA!&rf=viewer_4&t=5'
      },
      {
        images: 'http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/ruAMsa53pVQWN7FLK88i5omw5ZNs.ky3H2Kl7v9BBznVgP2B3u*zMgdwfuMCzyNsZFnuRJYyUEccZfvlwmLmhdVoisywoBoPuUxoxJP4jlE!/b&bo=OASgBTgEoAUDByI!&rf=viewer_4&t=5'
      },
      {
        images: 'http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/45NBuzDIW489QBoVep5mcW0lEv0uom7Z.icZnhSN*nqKxpYMIif6XTxQuAcb9Q6BfdloQmz5O5TvVdYj0wjrMh.NKGsKl3ipeVG7jnw9Mas!/b&bo=oAU4BKAFOAQDZ0I!&rf=viewer_4&t=5'
      },
      {
        images: 'http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/45NBuzDIW489QBoVep5mcdE*SNpz01fHDWEj*Obzz47p5jTo4piS2MQ24WhfUk.jE2MFPCaqsdUo6DaLb00mxm2XDlI0iUtAOg.CTtt4qhk!/b&bo=oAU4BKAFOAQDZ0I!&rf=viewer_4&t=5'
      },
      {
        images: 'http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/45NBuzDIW489QBoVep5mcdE*SNpz01fHDWEj*Obzz44weZ87J7mczQp0jzgpbNQCO6YmN8QDPXZgLnGWUD1HXPy78ps0r0BA2dmZm3XQa3o!/b&bo=KgQgAyoEIAMDZ0I!&rf=viewer_4&t=5'
      }
    ],
    canteenList: [{
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/ruAMsa53pVQWN7FLK88i5mUtN1YjE4uB4cRR4GyVcSXYkkQn4ueebynRrYuuUy76LfHyPVbg9xioGLfzWlT9RG.l0PsG3i2ZRaXM3iS4N*A!/b&bo=oAU4BKAFOAQDByI!&rf=viewer_4&t=5",
        title: "榆中男女宿舍，该宿舍风格在榆中较多，较好。"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0A6tex/ruAMsa53pVQWN7FLK88i5j0ugyufks8dD.dyFkMKbv3Sg3qSuvNzoWxHjTpfQN6*x4juS6Xrng0XgPLCpYBwp69Lj*6eKhSQBc3GCDCQMvA!/b&bo=gAJFBasCoAUBCeA!&rf=viewer_4&t=5",
        title: "榆中宿舍走廊，干净而宽敞明亮。"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/45NBuzDIW489QBoVep5mcW0lEv0uom7Z.icZnhSN*no8KLlV5vLh*IoLR2v32900UnZmLTrdQ4zQY.ey2JRFoLyKbo5fB6IWZVBnjJj3hpo!/b&bo=OASgBTgEoAUDd1I!&rf=viewer_4&t=5",
        title: "榆中宿舍较常见的书桌，摆放整齐有序。"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT2afHy4/45NBuzDIW489QBoVep5mcW0lEv0uom7Z.icZnhSN*nqKxpYMIif6XTxQuAcb9Q6BfdloQmz5O5TvVdYj0wjrMhmw3uUcFe9JTEZ9R.dJk58!/b&bo=oAU4BKAFOAQDZ0I!&rf=viewer_4&t=5",
        title: "榆中宿舍的床，上下床，部分宿舍为上床下桌。"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcZmol5gL5pK8kSTBCjL8Dx0tvNrOJy2*Ew5Bq18TzZH047OcpjLSgCmaBeoxSkF8efc61N0zJxYBdj9loU6AY7Y!/b&bo=OAQ4BDgEOAQFKQo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcYagQ26vAbbb4pk*mxKiZZkYh4l6J*3adeQTASxSLWQsA9r.3N6pTGi9j*GbHons5zINb0KsdJ1a6zHHvDK*Qvk!/b&bo=0AIcAtACHAIFGTo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcYagQ26vAbbb4pk*mxKiZZl1NQ7vyhgGmshPRjYWU3TNFXzqAPcljBK2fGOawc2qCN6XCo3PapGYCZTLrBDo8go!/b&bo=0AIcAtACHAIFGTo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcYagQ26vAbbb4pk*mxKiZZnGqzzrs.FMha22NB0Z*g56zfjB7HGVRCF5BrTnxqmxexC0bvWm5FmFFBLpfbSl3v0!/b&bo=OAQqAzgEKgMFGTo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcYagQ26vAbbb4pk*mxKiZZnojBMxp*eH9byzzzkExcyzxLKshqJCcvXWqZghoLz7inzZuZXVJQXjwZJNQUn2YeU!/b&bo=OAQqAzgEKgMFGTo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcdMFHaxVQ9hjOvHcuvuZf4cuV*J9zLbQlrTp.SxYMLCxcEHUIJrU*2zkU.3OWzpte0b.EFT2e.PkvPmc*zE3YUk!/b&bo=OAQqAzgEKgMFGTo!&rf=viewer_4&t=5",
        title: "数计院文明宿舍"
      },

      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcdMFHaxVQ9hjOvHcuvuZf4eZ6y4QloyfTlW3hGViSEcdvc2CXaHciNhOSwM.COAdlK4OYw76WoKi.hACDIWozdQ!/b&bo=DAMQBAwDEAQBGT4!&rf=viewer_4&t=5",
        title: "榆中上床下桌样式，条件较好"
      },
      {
        url: "http://m.qpic.cn/psc?/V51688fg1vRc9q3n3omH2cRMjT0txiTc/45NBuzDIW489QBoVep5mcdMFHaxVQ9hjOvHcuvuZf4eGP*YIdX6XcuIN48iVb.EYvbxY8WktBrBXsoBuozO4EMwo1ir6P*SoA28jD.ReC6M!/b&bo=DAMQBAwDEAQBGT4!&rf=viewer_4&t=5",
        title: "榆中上床下桌样式，条件较好"
      },
      {
        url: "https://6865-help-otukn-1302721115.tcb.qcloud.la/map/suse4.png?sign=090c9f203e770f9100b5fda309ac01c2&t=1597382742",
        title: "本部宿舍，条件较差。"
      }
    ],
    indicatorDots: true,
    autoplay: true,
    interval: 2000,
    duration: 1000,
    circular: true,
    beforeColor: "white", //指示点颜色 
    afterColor: "coral", //当前选中的指示点颜色 
    previousmargin: '30px', //前边距
    nextmargin: '30px', //后边距

  },

  //轮播图的切换事件 
  swiperChange: function (e) {
    this.setData({
      swiperCurrent: e.detail.current //获取当前轮播图片的下标
    })
  },
  //滑动图片切换 
  chuangEvent: function (e) {
    this.setData({
      swiperCurrent: e.currentTarget.id
    })
  },
  lookImage(e) {
    console.log(e)
    var that = this;
    var src = e.target.dataset.url; //获取data-src
    var imgList = [e.target.dataset.url]; //获取data-list
    //图片预览
    wx.previewImage({
      current: src, // 当前显示图片的http链接
      urls: imgList // 需要预览的图片http链接列表
    })
  }
})